<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>mat_get_submatrix</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="LIBIT Documentation"
HREF="index.html"><LINK
REL="UP"
HREF="refmanual.html"><LINK
REL="PREVIOUS"
TITLE="cmat_get_row"
HREF="man.cmat-get-row.html"><LINK
REL="NEXT"
TITLE="imat_get_submatrix"
HREF="man.imat-get-submatrix.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>LIBIT Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="man.cmat-get-row.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="man.imat-get-submatrix.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="MAN.MAT-GET-SUBMATRIX"
></A
>mat_get_submatrix</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN3785"
></A
><H2
>Name</H2
>mat_get_submatrix&nbsp;--&nbsp;Extract submatrix from input matrix</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN3788"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><P
></P
><A
NAME="AEN3789"
></A
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include &lt;it/mat.h&gt;
      </PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>mat mat_get_submatrix</CODE
>( mat m, idx_t r1, idx_t c1, idx_t r2, idx_t c2
        );</CODE
></P
><P
></P
></DIV
></DIV
><H2
>DESCRIPTION</H2
><P
> The function <CODE
CLASS="FUNCTION"
>mat_get_submatrix</CODE
> creates a new matrix containing elements of <CODE
CLASS="PARAMETER"
>m</CODE
> in range [<CODE
CLASS="PARAMETER"
>r1</CODE
>,<CODE
CLASS="PARAMETER"
>c1</CODE
>]x[<CODE
CLASS="PARAMETER"
>r2</CODE
>,<CODE
CLASS="PARAMETER"
>c2</CODE
>].  </P
><H2
>RETURN VALUE</H2
><P
>    Desired submatrix from input matrix
   </P
><H2
>EXAMPLE</H2
><PRE
CLASS="PROGRAMLISTING"
>&#13;#include &lt;mat.h&gt;

...

mat m = mat_new (3,3); 
mat s; 

m[0][0] = 1; m[1][1] = 4; m[2][2] = 7; 
m[0][0] = 2; m[1][1] = 5; m[2][2] = 8; 
m[0][0] = 3; m[1][1] = 6; m[2][2] = 9; 

s = mat_get_submatrix (m,1,2,2,2); 

/*
s = 
[[ 8 ]
 [ 9 ]]
*/</PRE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="man.cmat-get-row.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="man.imat-get-submatrix.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>cmat_get_row</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="refmanual.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>imat_get_submatrix</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>